<template>
  <view class="page">
    <nav-bar>
      <template #title>添加人员</template>
    </nav-bar>
    <view class="container">
        <avant-form
        ref="formRules"
        v-model="form"
        :option="options"
        @submit="submit"
      >
      </avant-form>
      <view class="sub-btn">
        <!-- <van-button type="primary" @click="proxy.$refs.formRules.reset()"
          >重置</van-button
        > -->
        <van-button type="primary" round size="large" @click="proxy.$refs.formRules.submit()"
          >提交</van-button
        >
      </view>
    </view>
  </view>
</template>
<script setup lang="ts">
import formOption from "./formOption";
const { proxy } = getCurrentInstance();

const options = computed(() => {
  return formOption(proxy);
});

const form = ref({
  post: "2",
  sex: "",
});

function submit(form) {
  console.log("form ------1111", form);
  navigate("navigateTo", "workspace");
}


</script>
<style lang="scss" scoped>
.container {
  width: 100%;
  height: calc(100% - 46px);
  .sub-btn {
    margin: 16px;
  }
}
</style>
